package cn.iocoder.yudao.module.crossborder.enums;

import cn.iocoder.yudao.framework.common.exception.ErrorCode;

/**
 * 跨境电商模块错误码常量
 * 
 * 错误码区间：[1-030-000-000 ~ 1-040-000-000)
 * 
 * 分配规则：
 * - 平台对接模块：[1-030-000-000 ~ 1-031-000-000)
 * - 商品管理模块：[1-031-000-000 ~ 1-032-000-000)
 * - 订单管理模块：[1-032-000-000 ~ 1-033-000-000)
 * - 库存管理模块：[1-033-000-000 ~ 1-034-000-000)
 * - 物流管理模块：[1-034-000-000 ~ 1-035-000-000)
 * - 财务管理模块：[1-035-000-000 ~ 1-036-000-000)
 * - 风险控制模块：[1-036-000-000 ~ 1-037-000-000)
 * - 合规管理模块：[1-037-000-000 ~ 1-038-000-000)
 * - CRM模块：[1-038-000-000 ~ 1-039-000-000)
 * - SRM模块：[1-039-000-000 ~ 1-040-000-000)
 * 
 * @author 芋道源码
 */
public interface CrossBorderErrorCodeConstants {

    // ========== 平台对接模块 [1-030-000-000 ~ 1-031-000-000) ==========
    
    // Amazon平台相关错误 [1-030-001-000 ~ 1-030-001-100)
    ErrorCode AMAZON_API_ERROR = new ErrorCode(1030001000, "Amazon API调用失败");
    ErrorCode AMAZON_TOKEN_EXPIRED = new ErrorCode(1030001001, "Amazon访问令牌已过期");
    ErrorCode AMAZON_TOKEN_REFRESH_FAILED = new ErrorCode(1030001002, "Amazon访问令牌刷新失败");
    ErrorCode AMAZON_RATE_LIMIT_EXCEEDED = new ErrorCode(1030001003, "Amazon API调用频率超限");
    ErrorCode AMAZON_UNAUTHORIZED = new ErrorCode(1030001004, "Amazon API认证失败");
    ErrorCode AMAZON_CONFIG_INVALID = new ErrorCode(1030001005, "Amazon平台配置无效");
    ErrorCode AMAZON_ORDER_NOT_FOUND = new ErrorCode(1030001006, "Amazon订单不存在");
    ErrorCode AMAZON_SYNC_FAILED = new ErrorCode(1030001007, "Amazon数据同步失败");
    
    // eBay平台相关错误 [1-030-002-000 ~ 1-030-002-100)
    ErrorCode EBAY_API_ERROR = new ErrorCode(1030002000, "eBay API调用失败");
    ErrorCode EBAY_TOKEN_EXPIRED = new ErrorCode(1030002001, "eBay访问令牌已过期");
    ErrorCode EBAY_TOKEN_REFRESH_FAILED = new ErrorCode(1030002002, "eBay访问令牌刷新失败");
    
    // Shopify平台相关错误 [1-030-003-000 ~ 1-030-003-100)
    ErrorCode SHOPIFY_API_ERROR = new ErrorCode(1030003000, "Shopify API调用失败");
    ErrorCode SHOPIFY_TOKEN_EXPIRED = new ErrorCode(1030003001, "Shopify访问令牌已过期");
    ErrorCode SHOPIFY_WEBHOOK_VERIFY_FAILED = new ErrorCode(1030003002, "Shopify Webhook验证失败");
    
    // 平台通用错误 [1-030-099-000 ~ 1-030-099-100)
    ErrorCode PLATFORM_NOT_SUPPORTED = new ErrorCode(1030099000, "不支持的电商平台");
    ErrorCode PLATFORM_CONFIG_NOT_FOUND = new ErrorCode(1030099001, "平台配置不存在");
    ErrorCode PLATFORM_STORE_NOT_FOUND = new ErrorCode(1030099002, "平台店铺不存在");
    ErrorCode PLATFORM_CONNECTION_FAILED = new ErrorCode(1030099003, "平台连接测试失败");
    ErrorCode PLATFORM_SYNC_IN_PROGRESS = new ErrorCode(1030099004, "平台数据同步正在进行中");

    // ========== 商品管理模块 [1-031-000-000 ~ 1-032-000-000) ==========
    ErrorCode PRODUCT_NOT_FOUND = new ErrorCode(1031001000, "商品不存在");
    ErrorCode PRODUCT_SKU_DUPLICATE = new ErrorCode(1031001001, "商品SKU重复");
    ErrorCode PRODUCT_CATEGORY_NOT_FOUND = new ErrorCode(1031001002, "商品分类不存在");
    ErrorCode PRODUCT_BRAND_NOT_FOUND = new ErrorCode(1031001003, "商品品牌不存在");
    ErrorCode PRODUCT_PRICE_INVALID = new ErrorCode(1031001004, "商品价格无效");

    // ========== 订单管理模块 [1-032-000-000 ~ 1-033-000-000) ==========
    ErrorCode ORDER_NOT_FOUND = new ErrorCode(1032001000, "订单不存在");
    ErrorCode ORDER_STATUS_INVALID = new ErrorCode(1032001001, "订单状态无效");
    ErrorCode ORDER_CANNOT_CANCEL = new ErrorCode(1032001002, "订单无法取消");
    ErrorCode ORDER_PAYMENT_FAILED = new ErrorCode(1032001003, "订单支付失败");
    ErrorCode ORDER_SHIPPING_FAILED = new ErrorCode(1032001004, "订单发货失败");

    // ========== 库存管理模块 [1-033-000-000 ~ 1-034-000-000) ==========
    ErrorCode INVENTORY_NOT_FOUND = new ErrorCode(1033001000, "库存不存在");
    ErrorCode INVENTORY_INSUFFICIENT = new ErrorCode(1033001001, "库存不足");
    ErrorCode WAREHOUSE_NOT_FOUND = new ErrorCode(1033001002, "仓库不存在");
    ErrorCode INVENTORY_ALLOCATION_FAILED = new ErrorCode(1033001003, "库存分配失败");

    // ========== 物流管理模块 [1-034-000-000 ~ 1-035-000-000) ==========
    ErrorCode SHIPPING_METHOD_NOT_FOUND = new ErrorCode(1034001000, "物流方式不存在");
    ErrorCode SHIPPING_TRACKING_FAILED = new ErrorCode(1034001001, "物流跟踪失败");
    ErrorCode SHIPPING_LABEL_GENERATE_FAILED = new ErrorCode(1034001002, "物流标签生成失败");

    // ========== 财务管理模块 [1-035-000-000 ~ 1-036-000-000) ==========
    ErrorCode PAYMENT_RECORD_NOT_FOUND = new ErrorCode(1035001000, "支付记录不存在");
    ErrorCode EXCHANGE_RATE_NOT_FOUND = new ErrorCode(1035001001, "汇率不存在");
    ErrorCode SETTLEMENT_FAILED = new ErrorCode(1035001002, "结算失败");

    // ========== 风险控制模块 [1-036-000-000 ~ 1-037-000-000) ==========
    ErrorCode RISK_RULE_NOT_FOUND = new ErrorCode(1036001000, "风险规则不存在");
    ErrorCode RISK_ASSESSMENT_FAILED = new ErrorCode(1036001001, "风险评估失败");
    ErrorCode HIGH_RISK_TRANSACTION = new ErrorCode(1036001002, "高风险交易");

    // ========== 合规管理模块 [1-037-000-000 ~ 1-038-000-000) ==========
    ErrorCode COMPLIANCE_RULE_NOT_FOUND = new ErrorCode(1037001000, "合规规则不存在");
    ErrorCode TAX_RULE_NOT_FOUND = new ErrorCode(1037001001, "税务规则不存在");
    ErrorCode COMPLIANCE_CHECK_FAILED = new ErrorCode(1037001002, "合规检查失败");

    // ========== CRM模块 [1-038-000-000 ~ 1-039-000-000) ==========
    ErrorCode CUSTOMER_NOT_FOUND = new ErrorCode(1038001000, "客户不存在");
    ErrorCode CUSTOMER_CONTACT_FAILED = new ErrorCode(1038001001, "客户联系失败");

    // ========== SRM模块 [1-039-000-000 ~ 1-040-000-000) ==========
    ErrorCode SUPPLIER_NOT_FOUND = new ErrorCode(1039001000, "供应商不存在");
    ErrorCode SUPPLIER_EVALUATION_FAILED = new ErrorCode(1039001001, "供应商评估失败");
}
